import request from "@/utils/http";

export const loginByPhoneAPI = (data) => {
  return request({ url: "/login/wxMin", data, method: "post" });
};

export const loginByTestAPI = (phoneNumber) => {
  return request({
    url: "/login/wxMin/simple",
    data: { phoneNumber },
    method: "post",
  });
};

export const getProfileAPI = () => {
  return request({ url: "/member/profile" });
};

export const uplodaPhotoAPI = (filePath) => {
  return uni.uploadFile({
    url: "/member/profile/avatar",
    name: "file",
    filePath,
  });
};
// 1.API
export const updateProfileAPI = (data) => {
  return request({
    url: "/member/profile",
    data,
    method: "put",
  });
};
